import { Router } from 'hyper-express';
import requireUser from '../../../middlewares/auth/requireUser';
import cache from '../../../middlewares/cache';
import rowLevelPermission from '../../../middlewares/auth/rowLevelPermission';
//#region AutoCreateCode
import { uctooSmsTemplateController } from '../../../controllers';
const uctoosmsTemplateRouter = new Router();
const smsTemplateController = new uctooSmsTemplateController();

uctoosmsTemplateRouter.post('/add', requireUser, smsTemplateController.add);
uctoosmsTemplateRouter.post('/edit', requireUser, rowLevelPermission('uctoo/sms_template'), smsTemplateController.edit);
uctoosmsTemplateRouter.post('/del', requireUser, rowLevelPermission('uctoo/sms_template'), smsTemplateController.delete);

//For getting smsTemplate with permission control
uctoosmsTemplateRouter.get('/:id', requireUser,  rowLevelPermission('uctoo/sms_template'), smsTemplateController.getSingle);
uctoosmsTemplateRouter.get('/:limit/:page', requireUser,  rowLevelPermission('uctoo/sms_template'), smsTemplateController.getMany);
uctoosmsTemplateRouter.get('/:limit/:page/:skip', requireUser,  rowLevelPermission('uctoo/sms_template'), smsTemplateController.getMany);

//#endregion AutoCreateCode
export default uctoosmsTemplateRouter;
